function init (config) {
  return {
    getHistory(send) {
      const url = `${config.agentSystem}${send.areaCode}`
      const queryObj = {
        source: {
          uid: send.uid,
          offset: send.offset || 0,
          limit: send.limit || 15,
          recordType: send.recordType
        },
        token: send.token,
        type: 5501
      }
      console.log('queryObj', JSON.stringify(queryObj))
      return fetch(url, {
        method: 'POST',
        body: JSON.stringify(queryObj)
      })
    },
    getTeamMemberBuyHistory(send) {
      const url = `${config.agentSystem}${Cookies.get('areaCode')}`
      const queryObj = {
        source: {
          lftid: send.lftid,
          offset: send.offset,
          limit: send.limit || 15
        },
        token: Cookies.get('token'),
        type: 5516
      }
      console.log('queryObj', JSON.stringify(queryObj))
      return fetch(url, {
        method: 'POST',
        body: JSON.stringify(queryObj)
      })
    }
  }
}

export default init